<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019/11/4
  Time: 21:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>河大附幼选课系统</title>
    <style type="text/css">
        *{
            padding: 0;
            margin: 0;
        }

        .login{
            width: 60%;
            height: 320px;
            margin-left:15%;
            margin-top: 100px;
            opacity: 0.7;
            background-color: white;
            position: absolute;
        }
        .loginTitle{
            width: 100%;
            text-align: center;
            color: #5CACEE;
            font-size: 2.5em;
            font-family: KaiTi;
            margin-top: 5%;
        }
        .password{
            width: 60%;
            margin-left: 20%;
            margin-top: 5%;
            text-align: center;
            font-size: 18px;
            font-family: KaiTi;
            color: #5CACEE;
        }
        .in{
            width: 80%;
            height: 32px;
            margin-left: 10px;
            text-indent: 10px;
            font-size: 18px;
            font-family: KaiTi;
            color: #5CACEE;
            opacity: 0.8;
            border:1px solid #5CACEE;
        }
        input::-webkit-input-placeholder{
            color: #5CACEE;
        }
        .button{
            width: 100%;
            margin-top: 10%;
            margin-left: 40px;
        }
        .btn_login{
            width: 20%;
            height: 32px;
            margin-left: 24%;
            border: none;
            outline:none;
            background-color: #5CACEE;
            color: white;
            cursor:pointer;
        }
        .btn_reset{
            width: 20%;
            height: 32px;
            margin-left: 12%;
            border: none;
            outline:none;
            background-color: #5CACEE;
            color: white;
            cursor:pointer;
        }
        button:hover{
            background-color: #0099FF;
        }
    </style>
    <script type="text/javascript">
        var msg = ${msg};
        if(msg==000){
            parent.location.href="student_login?m=6";
        }
    </script>
</head>
<body>
<div class="login">
    <div class="loginTitle">
        <p >修改密码界面</p>
    </div><br><br>
    <div>
            <div style="font-family: KaiTi;color: #5CACEE;font-size: 20px;margin-left: 160px;">
                学号:${student.stu_account}<br>
            </div>
            <div class="password">
                <input type="password" id="stu_password" name="stu_password" placeholder="请输入新密码" autocomplete="off" class="in" />
            </div>
            <div class="password">
                <input type="password" name="stu_newpassword" id="stu_newpassword" placeholder="请再次确认密码" class="in" />
            </div>
            <div class="button">
                <button class="btn_login" onclick="confirmPassword()" >确认</button>
                <button class="btn_reset" type="reset">重置</button>
            </div>
    </div>
</div>
</body>
<script>

    var confirmPassword = function () {
        var stu_password = $('#stu_password').val();
        var stu_newpassword = $('#stu_newpassword').val();
        if(stu_password==null||stu_password==""||stu_newpassword==null||stu_newpassword==""){
            alert("请正确输入");
        }
        else if(stu_password==stu_newpassword){
            //两次输入密码相等
           // alert("进这里了");
            window.location.href="student_update?stu_password="+stu_password;
            //alert("两次密码一直")
        }else {
            alert("两次密码输入不一致");
            $("#stu_password").val("");//置空
            $("#stu_newpassword").val("");
        }
    }
    // function goReturn() {
    //     window.history.go(-1);
    // }

</script>
</html>